<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js数据类型</title>
    <!-- 引入样式文件 -->
    <!-- <link rel="stylesheet" href="./css/index.css"> -->
    <!-- 引入js文件 -->
    <!-- <script src="./js/index.js"></script> -->
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            overflow: hidden;
            position: relative;
        }

        .container {
            text-align: center;
            padding-top: 10%;
        }
        .title {
            color: #409EFF;
            font-size: 50px;
        }
    </style>
</head>

<body>
    <div class="container">
        <h2 class="title">TypeScript</h2>
    </div>

    <script>

        /* --------------基本类型------------------ */
        // 字符串 String    
        let name = "张三"
        console.log('name:', name);

        //数字 Number  
        let age = 6
        console.log("age:", age);

        //布尔 Boolean  
        let flag = true
        console.log("flag:", flag);

        // 空  Null 
        let defaultValue = null;
        console.log("null:", defaultValue)

        //未定义 Undefined    
        // console.log('未定义:',totla)

        /* --------------对象类型------------------ */
        // 对象 Object   
        let userInfo = {
            name: "张三",
            age: "6"
        }
        console.log('对象:', userInfo);

        // 数组 Array     
        let roleCode = [100300, 100400, 100500]
        console.log("数组:", roleCode);

        //函数 Function 
        function sum(a, b) {
            return a + b;
        }
        // sum(2, 3)
        console.log(sum);

        // 正则表达式 RegExp   
        let reg_tel = /^[1][3-9]\d{9}$/;
        // reg_tel.test(13512345678)
        console.log(reg_tel);

        // 日期 Date
        const date = new Date()
        console.log(date);

    </script>



</body>

</html>